package com.zyuec.springUtil;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.zyuec.common.EncryptionUtil;

public class PoolConfigurationData extends org.apache.tomcat.jdbc.pool.DataSource{
    private static Logger logger = LoggerFactory.getLogger(PoolConfigurationData.class);

	
    
	 @Override
	 public String getUsername() {
		 logger.info("获取username!");
		 String username=getPoolProperties().getUsername();
	     return username;
	 }
	 
	 /**
	     * {@inheritDoc}
	     */

	    @Override
	    public void setPassword(String password) {
			password = EncryptionUtil.decrypt(password, EncryptionUtil.strDefaultKey);// null表示使用默认密钥
	        this.poolProperties.setPassword(password);
	        String pass=this.poolProperties.getPassword();
	        this.poolProperties.getDbProperties().setProperty("password",pass);
	    }
}
